<!DOCTYPE html>
<html  lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <!--360浏览器优先以webkit内核解析-->
    <link rel="shortcut icon" href="favicon.ico">
    <link href="../static/css/bootstrap.min.css" th:href="@{/css/bootstrap.min.css}" rel="stylesheet"/>
    <link href="../static/css/font-awesome.min.css" th:href="@{/css/font-awesome.min.css}" rel="stylesheet"/>
    <link href="../static/css/main/animate.min.css" th:href="@{/css/main/animate.min.css}" rel="stylesheet"/>
    <link href="../static/css/main/style.min862f.css" th:href="@{/css/main/style.min862f.css}" rel="stylesheet"/>
    <style>
        .head{
            height: 120px;
        }
        .info-bg{
            margin-left: 1%;
            width: 48%;
            height: 85%;
            margin-right:10px;
            border-radius: 10px;
            display: inline-block;
        }
        .primary-bg{
            margin-right: 1%;
            width: 48%;
            height: 96%;
            border-radius: 10px;
            float: right;
            display: inline-block;
        }
        .diagram{
            top: 50%;
            margin-top: 30px;
            margin-left: 30px;
        }
        .sell{
            float: right;
            margin: 7%;

        }
        .leave-word{
            float: right;
            margin: 5%;
        }
        .big-font{
            font-size: 1.5em;
        }
    </style>
</head>

<body class="gray-bg">
<tr th:each = "user:${list}">
    <td th:text = "${user.id}"></td>
    <td th:text = "${user.name}"></td>
</tr>
<div class="ibox-content"   th:each="tR,tMainLoginDTO:${list}" >
    <span class="big-font" th:text="${user.id}"></span>
    <span class="big-font" th:text="${user.name}"></span>
</div>
    <div class="wrapper wrapper-content" >
        <div class="row head" th:each="t,tMainDTO:${tMainDTO}">
            <div class="bg-info info-bg">
                <img th:src="@{/img/buy.jpg}" height="50px" class="diagram">
                <div class="sell" align="right" >当前在售<br/>
                    <span class="big-font" th:text="${t.houseNumber}"></span>
                </div>
            </div>
            <div class="bg-primary primary-bg ">
                <img th:src="@{/img/client.jpg}" height="60px" class="diagram">
                <div class="leave-word" align="right">当前客户<br/>
                    <span class="big-font" th:text="${t.clientNumber}"></span>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-4">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <h5>最新房源</h5>
                    </div>
                    <table class="table table-bordered table-hover table-condensed">
                        <thead>
                        <tr>
                            <th>房间类型</th>
                            <th>房间位置</th>
                            <th>房间价格</th>
                        </tr>
                        </thead>
                        <tbody id="Room"></tbody>
                    </table>
                </div>
            </div>
            <div class="col-sm-4">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <h5>网站简介</h5>
                    </div>
                    <div class="ibox-content">
                    </div>
                </div>
            </div>
            <div class="col-sm-4">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <h5>系统日志</h5>
                    </div>
                    <table class="table table-bordered table-hover table-condensed ibox-content">
                        <thead>
                        <tr>
                            <th>登录人</th>
                            <th>登录时间</th>
                        </tr>
                        </thead>
                        <tbody id="list"></tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>
    <script th:src="@{/js/jquery.min.js}"></script>
    <script th:src="@{/js/bootstrap.min.js}"></script>
    <script th:src="@{/ajax/libs/layer/layer.min.js}"></script>
    <script type="text/javascript">
        $(function() {
            $.ajax({
                type: "GET",
                url: "/system/main1",
                dataType: 'json',
                success: function (data) {
                    console.log(data)
                    $(data).each(
                        function (i, values) {
                            $("#Room").append(
                                "<tr><td>"+values.roomType+"</td>"
                                +"<td>"+values.roomPosition+"</td>"
                                +"<td>"+values.roomPrice+"</td></tr>"
                            );
                        }
                    );
                }
            });
            $.ajax({
                type: "get",
                url: "/system/main2",
                dataType: 'json',
                success: function (data) {
                    console.log(data)
                    $(data).each(
                        function (i, values) {
                            $("#list").append(
                                "<tr><td>"+values.loginName+"</td>"
                                +"<td>"+values.loginTime+"</td></tr>"
                            );
                        }
                    );
                }
            });
        });
    </script>
</body>
</html>
